package com.imti.mall.admin.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.imti.mall.common.Api.CommonResult;
import com.imti.mall.model.admin.query.UmsAdminLoginParam;
import com.imti.mall.model.admin.pojo.UmsAdmin;
import com.imti.mall.model.admin.pojo.UmsRole;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface UmsAdminService extends IService<UmsAdmin> {

    /**
     * 登录功能
     * @param umsAdminLoginParam 验证用户参数对象
     * @return 生成的JWT的token
     */
    @Transactional
    CommonResult login(UmsAdminLoginParam umsAdminLoginParam);

    /**
     * 获取当前登录后台用户
     */
    @Transactional
    UmsAdmin getCurrentAdmin();

    /**
     * 获取用户对于角色
     */
    @Transactional
    List<UmsRole> getRoleList(Long adminId);


    /**
     * 获取缓存服务
     */
    @Transactional
    UmsAdminCacheService getCacheService();

}
